Add the getter and setter of skip_fp8_weight_update_tensor#3015
Add the getter and setter of skip_fp8_weight_update_tensor#3015xrennvidia wants to merge 5 commits into
Conversation
Signed-off-by: Xiaowei Ren <xren@nvidia.com>
for more information, see https://pre-commit.ci
Greptile SummaryThis PR restores the
Confidence Score: 5/5Safe to merge — the change is a narrow, focused restoration of a deleted public interface with no behavioral regressions. The two new classmethods are simple wrappers around already-tested state; the setter's lazy initialization is an improvement over the previous bare No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant MCore as MCore (cuda_graphs.py)
participant FGSM as FP8GlobalStateManager
participant State as FP8GlobalState
Note over MCore,State: Setter — called during CUDA graph capture setup
MCore->>FGSM: set_skip_fp8_weight_update_tensor(True/False)
FGSM->>State: "create tensor if None (device=cuda, dtype=float32)"
FGSM->>State: fill_(skip)
Note over MCore,State: Getter — called to read current flag
MCore->>FGSM: get_skip_fp8_weight_update_tensor()
FGSM->>State: skip_fp8_weight_update_tensor
State-->>MCore: Optional[torch.Tensor]
Reviews (4): Last reviewed commit: "Merge branch 'main' into xren/fix_skip_f..." | Re-trigger Greptile |
return type fix Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Signed-off-by: Xiaowei Ren <103958965+xrennvidia@users.noreply.github.com>
ptrendx
left a comment
There was a problem hiding this comment.
I believe there could be a reason why Pawel removed those functions from this object and we may need to change MCore instead in order to have this be compatible with torch.compile. Setting 'request changes' status for now until @pggPL reviews it.
pggPL
left a comment
There was a problem hiding this comment.
LGTM
I didn't know that this is used in mcore, I've run the torch compile test with this code and it also passes.
|
/te-ci pytorch |
Description
The getter and setter of
skip_fp8_weight_update_tensorwere deleted in @pggPL 's PR2759, but MCore local Cuda Graph implementation still needs it (like here), so create this PR to recover it back.Type of change
Changes
Please list the changes introduced in this PR:
Checklist: